<!DOCTYPE html>

<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">


<h:head>



	<style type="text/css">
.ui-layout,.ui-layout-doc,.ui-layout-unit,.ui-layout-wrap,.ui-layout-bd,.ui-layout-hd
	{
	border: none;
}

.companyHeaderGrid tr,.companyHeaderGrid td {
	border: none;
}
</style>

</h:head>

<h:body>

	<ui:composition>



		<h:form id="new_trasporto_form">

			<p:panelGrid columns="3" id="trasporto-data-panel"
				style="min-width: 100%; margin: 0 auto"
				styleClass="companyHeaderGrid">


				<p:growl id="trasportoGrowl" autoUpdate="true"
					for="create_trasporto_growl" />


				<f:facet name="header">
					<p:outputLabel style="font-size: 15pt">Dati del trasporto da creare</p:outputLabel>
				</f:facet>

				<h:outputText value="Citta di Partenza: " />
				<p:autoComplete id="city_p"
					value="#{trasportoBean.newTrasporto.cittaPartenza}"
					label="Citta Partenza" completeMethod="#{cittaBean.complete}"
					var="c" required="true" itemLabel="#{c.name}" minQueryLength="3"
					itemValue="#{c}" forceSelection="true" converter="cittaConverter"
					requiredMessage="Inserire la citta">
					<p:ajax event="itemSelect" update="city_p" />
				</p:autoComplete>
				<p:message display="text" for="city_p" />


				<h:outputText value="Citta di Arrivo: " />
				<p:autoComplete id="city_a"
					value="#{trasportoBean.newTrasporto.cittaArrivo}"
					label="Citta Partenza" completeMethod="#{cittaBean.complete}"
					var="c" required="true" itemLabel="#{c.name}" minQueryLength="3"
					itemValue="#{c}" forceSelection="true" converter="cittaConverter"
					requiredMessage="Inserire la citta">
					<p:ajax event="itemSelect" update="city_a" />
				</p:autoComplete>
				<p:message display="text" for="city_p" />

				<h:outputText value="Data Trasporto: " />
				<p:calendar value="#{trasportoBean.newTrasporto.data}"
					id="cal_partenza" showButtonPanel="true" required="true"
					requiredMessage="Inserire la data del trasporto"
					mindate="#{pacchettoBean.CURRENT_DATE}" readonlyInput="true">

				</p:calendar>
				<p:message display="text" for="cal_partenza" />

				<h:outputText value="Prezzo: " />
				<p:inputText id="prezzo_trasporto" required="true"
					requiredMessage="Inserire un prezzo per il trasporto"
					value="#{trasportoBean.newTrasporto.prezzo}" />
				<p:message display="text" for="prezzo_trasporto" />

				<h:outputText value="Posti disponibili: " />
				<p:inputText id="disponibilita" required="true"
					requiredMessage="Inserire il numero di posti disponibili"
					value="#{trasportoBean.newTrasporto.disponibilita}" />
				<p:message display="text" for="disponibilita" />

				<f:facet name="footer">
					<p:commandButton value="Conferma"
						action="#{trasportoBean.addTrasporto}"
						update="trasporto-data-panel" />

				</f:facet>
			</p:panelGrid>
		</h:form>


	</ui:composition>

</h:body>
</html>